#ifndef __TIME_C
#define __TIME_C
#include "time.h"
using namespace std;


Time::Time(){
   _tiempo = 0.0;
}

void Time::begin(){
   struct timeval t;
   gettimeofday(&t,NULL);
   _tiempo = t.tv_sec + t.tv_usec/1000000.0;
}

void Time::end(){
   struct timeval t;
   gettimeofday(&t,NULL);
   _tiempo = (t.tv_sec +t.tv_usec/1000000.0) - _tiempo;
}

void Time::print(ostream& out){
   out<<_tiempo;
}

ostream& operator <<(ostream& out,Time t){
   t.print(out);
   return out;
}


#endif

